package com.company.huisuo.biz.dialog

import android.app.Activity
import android.view.WindowManager
import android.widget.TextView
import com.company.huisuo.R
import com.company.huisuo.ext.dp2px
import com.lxj.xpopup.core.BottomPopupView


class CartPayDialog(activity: Activity, val scanClick: () -> Unit) : BottomPopupView(activity) {

    override fun getImplLayoutId(): Int {
        return R.layout.dialog_cart_pay
    }

    override fun onCreate() {
        super.onCreate()

        // 阻止软键盘自动弹出
        dialog?.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN)

        val tvQianTai = findViewById<TextView>(R.id.tv_qiantai)
        val memberPay = findViewById<TextView>(R.id.tv_member)

        tvQianTai.setOnClickListener {
            dismiss()
        }
        memberPay.setOnClickListener {
            scanClick.invoke()
            dismiss()
        }
    }

}